extends Sprite2D

var clickIcon = false

# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	texture = load("res://icon.svg") as Texture2D
	pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta: float) -> void:
	pass
func _input(_event: InputEvent) -> void:
	if _event is InputEventMouseButton:
		if _event.is_pressed():
			if _event.button_index == 1:
				clickIcon = true
				self.position = _event.position
		elif _event.is_released():
			if _event.button_index == 1:
				clickIcon = false
		else:
			print("抬起了鼠标按键")
	elif _event is InputEventMouseMotion:
		if clickIcon:
			self.position = _event.position

	pass
